<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
*/

$app->get('/', function(){
	echo "welcome to ptime3inform api.";
	
	// echo date("Y-m-d H:i:s");
});


	//用户
	$app->post 	('/user', 				'UserController@store');
	//$app->get 	('/user', 				'UserController@index');
	//$app->get 	('/user/{id}', 			'UserController@show');
	$app->put 	('/user/{id}', 			'UserController@update');
	//$app->delete('/user', 				'UserController@destroy');

	//用户通知途径
	$app->get 	('/user/{id}/method', 				'UserMethodController@index');
	$app->post 	('/user/{id}/method/{mid}', 		'UserMethodController@store');
	$app->delete('/user/{id}/method/{mid}', 		'UserMethodController@destroy');
	$app->put 	('/user/{id}/method/{mid}/grade', 	'UserMethodController@updateGrade');

	//应用
	//$app->post 	('/app', 				'AppController@store');
	//$app->get 	('/app', 				'AppController@index');
	//$app->get 	('/app/{id}', 			'AppController@show');
	//$app->put 	('/app/{id}', 			'AppController@update');
	//$app->delete('/app', 				'AppController@destroy');

	//消息集
	$app->post 	('/set', 				'SetController@store');
	$app->get 	('/set', 				'SetController@index');
	//$app->get 	('/set/{id}', 			'SetController@show');
	$app->put 	('/set/{id}', 			'SetController@update');
	$app->delete('/set/{id}', 			'SetController@destroy');

	$app->delete('/set/{id}/user/{uid}','SetController@destroyUser');

	$app->get 	('/set/{id}/message', 	'SetMessageController@index');

	//触发
	$app->get 	('/inform/check', 		'InformCheckController@index');
	$app->get 	('/message/check', 		'MessageCheckController@index');

	//通知
	$app->post 	('/inform', 			'InformController@store');
	//$app->get 	('/inform', 			'InformController@index');
	$app->get 	('/inform/{id}', 		'InformController@show');
	//$app->put 	('/inform/{id}', 		'InformController@update');
	//$app->delete('/inform', 			'InformController@destroy');

	$app->post 	('/inform/send', 		'InformController@send');
	$app->put 	('/inform/{id}/close', 	'InformController@close');

	$app->put 	('/inform/{id}/send', 	'InformSendController@index');
	$app->get 	('/inform/{id}/reply', 	'InformReplyController@index');

	//消息
	$app->get 	('/message', 			'MessageController@index');
	$app->get 	('/message/count', 		'MessageController@count');
	//$app->get 	('/message/{id}', 		'MessageController@show');

	//$app->get 	('/message/{id}/reply', 'MessageReplyController@index');
	$app->post 	('/message/{id}/reply', 'MessageReplyController@store');
